# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer:
pkgname=youtube-dlc
pkgver=2020.11.10
pkgrel=3
pkgdesc="Command-line program to download videos from YouTube"
url="https://blackjack4494.github.io/youtube-dlc"
arch="noarch"
license="Unlicense"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-flake8 py3-nose"
subpackages="$pkgname-doc
	$pkgname-bash-completion
	$pkgname-fish-completion"
source="https://github.com/blackjack4494/yt-dlc/archive/$pkgver/yt-dlc-$pkgver.tar.gz"
builddir="$srcdir/yt-dlc-$pkgver"

prepare() {
	default_prepare
	sed -i \
		-e 's|etc/bash_completion.d|share/bash-completion/completions|' \
		-e 's|etc/fish/completions|share/fish/completions|' \
		./setup.py
}

build() {
	python3 setup.py build
}

check() {
	PYTHON=/usr/bin/python3 make offlinetest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="5b732c421861ca5913fc712aa41a8dea428061b85d5fc6ea4c557d0c37b5a734eeec5490cd19bbe1c43ef48bba211969008c82677f9ff44fabfb08762b2ae185  yt-dlc-2020.11.10.tar.gz"
